package com.zengqingfa.designpattern.create.builder.simple;

/**
 *
 * @fileName: ConcreteBuilder
 * @author: zengqf3
 * @date: 2021-4-22 14:20
 * @description:
 */
public class ConcreteBuilder {

    private ProductParam parmas;

    public ConcreteBuilder() {
        this.parmas = new ProductParam();
    }

    public ConcreteBuilder setPart1(String part1) {
        parmas.part1 = part1;
        return this;
    }

    public ConcreteBuilder setPart2(String part2) {
        parmas.part2 = part2;
        return this;
    }

    public Product builder() {
        Product product = new Product();
        product.apply(parmas);
        return product;
    }

    public static class ProductParam {
        public String part1;
        public String part2;
    }
}
